package com.lokyiu.mybible.service.impl;

import java.util.List;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.lokyiu.mybible.dao.BibleBookDao;
import com.lokyiu.mybible.db.sqlite.BibleBookDaoImpl;
import com.lokyiu.mybible.domain.BibleBook;
import com.lokyiu.mybible.service.BibleBookService;

public class BibleBookServiceImpl extends AbstractAndroidService implements BibleBookService {

	public BibleBookServiceImpl(Context context) {
		super(context);
	}

	public BibleBookServiceImpl(SQLiteDatabase db) {
		super(db);
	}
	
	@Override
	public void save(List<BibleBook> books) {
		BibleBookDao dao = new BibleBookDaoImpl(getWritableDatabase());
		dao.saveBooks(books);
	}

	@Override
	public List<BibleBook> getBooks() {
		BibleBookDao dao = new BibleBookDaoImpl(getReadableDatabase());
		return dao.getBooks();
	}

}
